//
//  SDBaseViewController.m
//  SuperDoctor
//
//  Created by 李忠 on 7/5/16.
//  Copyright © 2016 SD. All rights reserved.
//

#import "SDBaseViewController.h"
#import "UIViewController+JASidePanel.h"
#import "UIBarButtonItem+SDExtension.h"

@interface SDBaseViewController ()

@end

@implementation SDBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = WHITE_COLOR;
    self.navigationController.navigationBar.tintColor = kThemeColor;
    [self setUpLeftButtonItem];
}

/*!
 *  默认修改了左上角的item值
 */
- (void)setUpLeftButtonItem{

    self.navigationItem.leftBarButtonItem = [UIBarButtonItem initWithImageStr:@"JianTou" addTarget:self withAction:@selector(goBack)];
}

/*!
 *  如果想修改任意跳转，修改goBack方法
 */
- (void)goBack{
    
    [self.navigationController popViewControllerAnimated:YES];
    
}

//  ***********************【 侧滑 】**********************
/** 中间的nav */
- (UINavigationController *)centerNavigationController{
    
    return (UINavigationController *)self.sidePanelController.centerPanel;
}
/** 左侧的VC*/
- (UIViewController *)leftViewController{
    
    return self.sidePanelController.leftPanel;
    
}
//  ***********************【 侧滑 】**********************

//MARK: - 跳转其他VC
- (void)jumpOtherViewController:(UIViewController *)otherVC{
    
    //显示中间
    [self.sidePanelController showCenterPanelAnimated:YES];
    
    //Push 到其他的控制器
    [[self centerNavigationController] pushViewController:otherVC animated:YES];
}



@end
